Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Example of VectorSource with a Third Party Tileset #1449

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tylergaw
Copy link

This PR

Adds a new example ThirdPartyVectorTileSource.js showing how to use VectorSource to consume a custom tileset. In #1448 I described an issue I ran into trying to do this. It's not an issue with the library, but I was confused by what I needed to do.

The key thing that I missed from the docs was that I needed to use a TileJSON file for the url property of VectorSource. I was incorrectly trying to use the tile url directly.

How to Test

  • Check out this branch
  • cd example && npm i
  • npm start
  • react-native run-ios
  • In the examples list, look for "Third Party Vector Tile Source"

The example should show a map centered on Chicago with green lines indicating...I'm not real sure what the data is, but there should be a bunch of green lines.

example screenshot
example

lineOpacity: 0.6,
lineColor: "rgb(53, 175, 109)",
lineWidth: 2
},
});

const VECTOR_SOURCE_URL =
'https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt';
const TILEJSON_URL = "https://s3.amazonaws.com/tgaw/tilejson.json";
Copy link
Author

@tylergaw tylergaw Dec 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we'll want to leave this URL in place. That's an object in an S3 bucket that I own.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea something we can do is just add a local tilejson file to the example app, so we can pull it off of the devices file system

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sweet, didn't realize that could be a local file. I can update the example to use that instead. Also need to update my app to do the same.

@nitaliano
Copy link
Owner

This is a great example, we can get it worked into the v7 branch

@StasDoskalenko
Copy link

@nitaliano so v7 branch is still maintained? ;)

@nitaliano
Copy link
Owner

Yes, I'm working on it again. IDK how much official support this repo will get(most likely none) but I plan to keep helping maintaining it along with others in the community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants